<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix = "c"  uri = "http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML>
<html lang="en-US">
  <head>
    <link rel="stylesheet" type="text/css"  href="css/bootstrap.min.css"/>
	<title>凯胜项目管理系统</title>
	<style type="text/css">
		body{
			padding-top:70px;
		}
	</style>

  </head>
  
 <body class="body">
	<%@include file="same2.jsp" %>
	
	<div class="container">
	
		<div class="row">
			<%@include file="same.jsp" %>
			<div class="span9" >
			
				<div class="clear"></div>
				<form id = "myform" class="form-horizontal" action ="file.jspx?method=newFile&id=${param.id }" method="post" enctype = "multipart/form-data">
					<fieldset>
					  <legend>分享新文件</legend>
					  <c:choose>
						<c:when test="${param.code == 1002}">
							<div class = "modal hide "  id="mymodal" >
								<div class = "modal-body" style = "text-align:center;height:40px;margin-top:50px">
										<div ><img alt="" src="img/file_success.png">文件已上传成功！ 是否继续上传新文件？</div>		
								</div>
								<div class = "modal-footer">
									<a href="#" class = "btn btn-primary" data-dismiss = "modal">是</a>
									<a href="file.jspx?method=toSingleFile&id=${sessionScope.singleFilesId.id}" class = "btn " >否</a>
								</div>
							</div>
						</c:when>
					</c:choose>
					  <div class="control-group">
						<label class="control-label" for="input01" >文件名称</label>
						<div class="controls">
						  <input type="text" class="span5" id="input01" x-webkit-speech="undefined" name = "filename">
						</div>
					  </div>
					 
					  
					  <div class="control-group">
						<label class="control-label" for="input01"></label>
						<div class="controls">
						<span id = "myspan" style = "color:red"></span><br>
						  <input id = "ff" type="file" class="span5" id="input01" x-webkit-speech="undefined" name = "name">
						</div>
					  </div>

					  <div class="form-actions">
						<input type="button" id = "mysub" class="btn btn-primary" value = "上传">
						<a class="btn" href = "file.jspx?method=toSingleFile&id=${sessionScope.singleFilesId.id}">返回</a>
					  </div>
					</fieldset>
				</form>                   					
			</div>
	</div>
</div>	
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src = "js/bootstrap.min.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$("#myid li").eq(5).addClass("active");
			$("#myid i").eq(3).addClass("  icon-white");
			$("#mymodal").modal("show");
			$("#mysub").click(function(){
			var val = $("#ff").val();
			if(val.length == 0){
				$("#myspan").html("请上传文件");
			}else{
				$("#myform").submit();
			}
			
		});
		});
		
	</script>
</body>
</html>
